package com.chengyu.core.request;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 分页
 *
 * @author fengxiaofeng fengxiaofeng@dhcc.com.cn
 * @since 1.0.0 2020-11-25
 */
@Data
public class PageReq implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "页码")
    private Long page;
    @ApiModelProperty(value = "显示行数")
    private Long limit;

    @ApiModelProperty(value = "排序字段列表；有先后顺序。可以为空")
    private List<Order> orders;

    /**
     * 排序对象
     */
    @Data
    public static class Order {

        @ApiModelProperty(value = "排序的列")
        private String column;
        @ApiModelProperty(value = "排序：true 表示降序，false 表示倒序")
        private boolean asc = true;
    }

}
